package com.jl.scr;

public class REM extends SCR{
	
	private final static String REM = "REM ";
	private final static String ENDL = "\n";
	
	private String data;
	public REM(String data){
		this.data = data;
	}
	
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append(REM).append(data).append(ENDL);
		return builder.toString();
	}

	@Override
	public boolean equals(Object obj) {
		if(obj == null){
			return false;
		}else if(obj == this){
			return true;
		}else if(!(obj instanceof REM)){
			return false;
		}else {
			REM rem = (REM) obj;
			return rem.toString().equalsIgnoreCase(this.toString());
		}
	}

	@Override
	public int hashCode() {
		return this.toString().hashCode();
	}
	
	public static REM parse(String rem){
		rem = rem.trim();
		return new REM(rem.substring(rem.indexOf(' ')));
	}
	
}
